package com.bdqn.entity;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Pet 宠物
 *
 * @author LILIBO
 * @since 2025/1/17
 */
public class Pet {

    /**
     * 日志
     */
    private static final Logger log = LoggerFactory.getLogger(Pet.class);

    private String name; // 名称
    private int age; // 年龄

    public Pet() {
    }

    public Pet(String name) {
        this.name = name;
    }

    /**
     * 自我介绍
     */
    public void sayHi() {
        System.out.println("我是“" + this.name + "”，今年" + this.age + "岁。");
    }

    @Override
    public String toString() {
        return "Pet{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        log.debug("Pet对象的 setName 方法被调用！参数 name = {}", name);
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        log.debug("Pet对象的 setAge 方法被调用！参数 age = {}", age);
        this.age = age;
    }

}
